package com.bltec.emergency.service.recordService.impl;

import com.bltec.emergency.mapper.RecordResponseMapper;
import com.bltec.emergency.model.RecordResponse;
import com.bltec.emergency.service.recordService.RecordResponseService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RecordResponseServiceImpl implements RecordResponseService {
    @Resource
    RecordResponseMapper recordResponseMapper;

    @Override
    public boolean add(RecordResponse recordResponse) {
        return recordResponseMapper.insert(recordResponse);
    }

    @Override
    public boolean deleteResponseById(Long id) {
        return recordResponseMapper.setDisableById(id);
    }

    @Override
    public boolean updateResponseById(RecordResponse recordResponse) {
        return recordResponseMapper.updateResponseById(recordResponse);
    }

    @Override
    public Long getIdByName(String name) {
        return recordResponseMapper.getIdByName(name);
    }

    @Override
    public RecordResponse getResponseById(Long id) {
        return recordResponseMapper.getResponseById(id);
    }

    @Override
    public RecordResponse getResponseByName(String name) {
        return recordResponseMapper.getResponseByName(name);
    }

    @Override
    public List<RecordResponse> getAll() {
        return recordResponseMapper.selectAll();
    }
}
